package blog.open1111.service.impl;

import blog.open1111.dao.ArticleDao;
import blog.open1111.entity.Article;
import blog.open1111.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by dengwubo on 2017/9/12.
 */

@Service
@SuppressWarnings("all")
public class ArticleServiceImpl implements ArticleService {
    @Autowired
    private ArticleDao articleDao;
    @Override
    public Integer getNumByTypeId(Integer typeId) {
        return articleDao.getNumByTypeId(typeId);
    }

    @Override
    public List<Article> list(Map<String, Object> map) {
        return articleDao.list(map);
    }

    @Override
    public Long getTotal(Map<String, Object> map) {
        return articleDao.getTotal(map);
    }

    @Override
    public List<Article> getHot() {
        return articleDao.getHot();
    }

    @Override
    public Integer add(Article article) {
        return articleDao.add(article);
    }

    @Override
    public Integer update(Article article) {
        return articleDao.update(article);
    }

    @Override
    public Integer delete(Integer id) {
        return articleDao.delete(id);
    }

    @Override
    public Article findById(Integer id) {
        return articleDao.findById(id);
    }

    @Override
    public List<Article> list2(Map<String, Object> map) {
        return articleDao.list2(map);
    }

    @Override
    public Long getTotal2(Map<String, Object> map) {
        return articleDao.getTotal2(map);
    }

    @Override
    public Article getLastArticle(Integer id) {
        return articleDao.getLastArticle(id);
    }

    @Override
    public Article getNextArticle(Integer id) {
        return articleDao.getNextArticle(id);
    }
}
